package com.woniuxy.three.pms.combo.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.woniuxy.three.pms.bean.ComboBean;
import com.woniuxy.three.pms.combo.service.IComboService;
@Controller
public class ComboController {
		@Autowired
		private IComboService service;
		
		
		@GetMapping("/combo")
		@ResponseBody
		public List<ComboBean> findall() {
			List<ComboBean> list=service.findall();
			return list;
		}
		
		
		@GetMapping("/combo/id/{id}")
		@ResponseBody
		public ComboBean	findbyid(@PathVariable Integer id) {
			ComboBean bean=service.selectByPrimaryKey(id);
			return bean;
		}
		
		@PostMapping("/combo")
		@ResponseBody
		public int updateByPrimaryKeySelective(ComboBean record) {
			int number=service.updateByPrimaryKeySelective(record);
			return number;
		}
		
		@PutMapping("/combo")
		@ResponseBody
		public int insertSelective(ComboBean record) {
			int number=service.insertSelective(record);
			return number;
		}
		
		@DeleteMapping("/combo/id/{id}")
		@ResponseBody
		public int deleteByPrimaryKey(@PathVariable Integer id) {
			int number=service.deleteByPrimaryKey(id);
			return number;
		}
}
